layui.use(['jquery', 'layer'], function () {
    var $ = layui.jquery,
        layer = layui.layer;

    let result = loginUserAjax();
    let userId = result.data;

    let loginResult = commonAjax('/user/findById', {id: userId}, 'get');
    setUser(loginResult.data);

    /**
     * 赋值
     * @param data
     */
    function setUser(data) {
        $('#loginUser').html(data.username);
        if (data.avatar !== null && data.avatar !== undefined && data.avatar !== '') {
            $('#userAvatar').attr('src', data.avatar);
        }
    }

    /**
     * 签到管理的点击事件
     */
    let loginUserSign = $('#loginUserSign');
    loginUserSign.on('click', function () {
        /*if (loginResult.data.userRole!==6){
            layer.msg("您不是组长哦!", {icon: 5, time: 2000, shade: 0.4});
        }*/
    });

});